package com.xbongbong.saas.domain.dao;

import com.xbongbong.saas.domain.entity.DistributorAreaEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

@Mapper
@Repository
public interface DistributorAreaDao {
    Long insert(DistributorAreaEntity entity);

    void insertBatch(List<DistributorAreaEntity> list);

    DistributorAreaEntity getByKey(@Param("key") Long key, @Param("corpid") String corpid );

    Integer update(DistributorAreaEntity entity);

    List<DistributorAreaEntity> findEntities(@Param("param") Map<String, Object> param);

    Integer getEntitiesCount(@Param("param") Map<String, Object> param);

    Integer deleteBatch(@Param("list") List<Long> idIn, @Param("corpid") String corpid);

    /**
     *  批量更新
     * @param list
     * @param corpid
     * @return
     */
    Integer updateBatch(@Param("list") List<DistributorAreaEntity> list,@Param("corpid") String corpid);

    /**
     * 根据主键删除记录
     *
     * @param key    主键
     * @param corpid 公司id
     * @return java.lang.Integer
     * @author 吴峰
     * @date 2019/3/22 9:48
     */

    Integer deleteByKey(@Param("key") Long key, @Param("corpid") String corpid);
}
